Skip to content

fix(ui): implement orientation adaptive design audit recommendations#1141

Merged
cursor[bot] merged 43 commits into
mainfrom
implement-audit-recommendations-fix
Jul 25, 2026
Merged

fix(ui): implement orientation adaptive design audit recommendations#1141
cursor[bot] merged 43 commits into
mainfrom
implement-audit-recommendations-fix

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary - Fix cross-mode search performance findings: prescribing catalogue debounce/abort/fields=index, differentials abort/debounce, universal documents typeahead soft-timeout (750ms), shared (search-app) shell to avoid composer remount, and Answer rate-limit in-memory fallback outside production. - Fix Bugbot regressions: shared-shell pathname navigation (/services → /dsm) syncs searchMode during render (no stale-mode paint) even when the query string is unchanged; extracted ClinicalDashboard lazy imports to stay under the maintainability budget. RAG impact: no retrieval behaviour change — typeahead documents domain timeout and shell URL sync only; ranking formulas and full /api/search retrieval path unchanged. ## Verification - [x] npm run verify:pr-local — focused Vitest on touched sources (362) plus api-rate-limit / search-shell / universal / route / site-map suites green; docs:check-index OK - [x] UI verification not run: full verify:ui not required for this pass; mode-home smoke via npm run ensure returned HTTP 200 for /, /services, /dsm, /documents/search, /therapy-compass, /?mode=prescribing, and /api/answer/stream returned 200 after the rate-limit fallback fix - Verification not run: eval:retrieval:latency / soak / live OpenAI canary — approval-gated provider work; not needed for timeout-only typeahead change ## Risk and rollout - Risk: medium — shared layout remount change and rate-limit fallback behaviour in non-production; production Answer/upload still fail closed when the durable limiter is unavailable - Rollback: revert this PR; mode routes return to per-segment GlobalSearchShell layouts and prior timeout/fallback behaviour - Provider or production effects: None ## Clinical Governance Preflight - [x] Source-backed claims still require linked source verification before clinical use - [x] No patient-identifiable document workflow was introduced or expanded without explicit governance approval - [x] Supabase target remains [REDACTED] ([REDACTED]) - [x] Service-role keys and private document access remain server-only - [x] Demo/synthetic content remains clearly separated from real clinical sources - [x] Source metadata, review status, and outdated/unknown-source behavior remain conservative - [x] Deployment classification/TGA SaMD impact was checked when clinical decision-support behavior changed ## Notes - Prescribing list rows keep the full catalogue payload so Safety/Monitoring filters and patient alerts still see section-derived signals; keystroke storms are controlled by debounce + abort. fields=index remains for identity-only consumers (cross-mode links). - Live hybrid RPC cold tails remain a separate approval-gated follow-up. ## Summary by CodeRabbit - Bug Fixes - Improved focus handling when opening and closing dialogs, including more reliable focus restoration. - Prevented conflicting sheet height styles when custom maximum-height settings are provided. - Improved expanded table layouts and fullscreen rendering. - Adjusted search dropdown sizing to show more results across viewport sizes. - Improved dashboard drawer behavior at supported breakpoints. - Tests - Added coverage for search dropdown sizing and dashboard layout safeguards. - Strengthened UI checks for asynchronous keyboard navigation and focus restoration. - Documentation - Updated review and merge-readiness tracking records.

@supabase

supabase Bot commented Jul 24, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@BigSimmo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 15 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c7510b78-cd5c-41d5-b44a-957958e7875f

📥 Commits

Reviewing files that changed from the base of the PR and between 05373f1 and 82efa0d.

📒 Files selected for processing (3)
  • docs/branch-review-ledger.md
  • src/components/ui/sheet.tsx
  • tests/ui-smoke.spec.ts
📝 Walkthrough

Walkthrough

Updated table and dropdown viewport layouts, UtilityDrawer initialization, Sheet focus retry and cleanup behavior, related UI tests, and branch review ledger records.

Changes

UI behavior updates

Layer / File(s) Summary
Expanded layout and dropdown constraints
src/components/AccessibleTable.tsx, src/components/clinical-dashboard/universal-search-command-surface.tsx, src/components/universal-search-command-mockups.tsx
Expanded table content uses flex sizing, while search dropdowns use viewport-based height constraints.
Sheet focus and height lifecycle
src/components/clinical-dashboard/dashboard-shell.tsx, src/components/ui/sheet.tsx
UtilityDrawer derives initial sheet mode from its breakpoint; Sheet focus retries, cleanup, and caller-provided max-height handling are updated.
Behavior and source guards
tests/clinical-dashboard-merge-artifacts.test.ts, tests/search-command-surface.test.ts, tests/ui-smoke.spec.ts
Tests cover safe-area padding exclusions, dropdown height classes, and asynchronous focus restoration.

Review ledger maintenance

Layer / File(s) Summary
Append-only maintenance records
docs/branch-review-ledger.md
Ledger entries record synchronization, merge, CI, thread, and maintenance outcomes for multiple pull requests.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant UtilityDrawer
  participant Sheet
  participant FocusTarget
  UtilityDrawer->>Sheet: initialize sheet mode from breakpoint
  Sheet->>FocusTarget: resolve and focus eligible target
  Sheet->>Sheet: retry focus while document focus remains on body
  Sheet->>FocusTarget: restore focus on close
  Sheet->>Sheet: clear retry interval on close or unmount
Loading

Possibly related PRs

Suggested labels: codex

Suggested reviewers: claude, cursoragent

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and broadly matches the UI/audit-oriented fixes, though it is broader than the specific search and focus changes.
Description check ✅ Passed The description follows the required template and includes Summary, Verification, Risk and rollout, Clinical Governance Preflight, and Notes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch implement-audit-recommendations-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 02ce93edf7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/components/clinical-dashboard/universal-search-command-surface.tsx Outdated
@BigSimmo

Copy link
Copy Markdown
Owner Author

@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. After fixing or dispositioning a thread, reply in that thread with as the first line, followed by a concise summary; that marker authorizes the workflow to close that exact thread. If human input or new authorization is required, do not use the marker and leave the thread open with the blocker. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 02ce93edf7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/components/clinical-dashboard/universal-search-command-surface.tsx Outdated
cursoragent and others added 6 commits July 24, 2026 06:16
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
GraphQL review-thread replies returned 403; resolved the fixed duplicate-height threads directly after validation.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
# Conflicts:
#	docs/branch-review-ledger.md

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo enabled auto-merge July 24, 2026 11:13
@BigSimmo

Copy link
Copy Markdown
Owner Author

@cursoragent Fix merge conflicts

@cursor

cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Merge conflicts on PR #1141 are resolved.

  • Merged origin/main into implement-audit-recommendations-fix (commit 5aec89d0); Git auto-merged cleanly (including ClinicalDashboard.tsx, sheet.tsx, and the review ledger).
  • Pushed; PR is MERGEABLE again (status BLOCKED is only remaining required checks/reviews, not conflicts).
  • Focused tests passed: tests/search-command-surface.test.ts, tests/sheet.dom.test.tsx (12/12).
Open in Web Open in Cursor 

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 04d07f21ef

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/components/ClinicalDashboard.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d0b988ad03

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/components/ui/sheet.tsx Outdated
cursoragent and others added 4 commits July 24, 2026 17:23
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
…mendations-fix

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo disabled auto-merge July 24, 2026 19:14
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

BigSimmo and others added 2 commits July 25, 2026 12:15
The Sources opener retry must not reclaim focus when another dialog already became active (mobile Guide opened from the Clinical Guide menu).

Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

BigSimmo added 2 commits July 25, 2026 13:09
Default UtilityDrawer sheet mode for breakpoint=all and retry sheet autofocus so the Find-a-document field keeps focus after drawer mount races.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/ui/sheet.tsx`:
- Around line 211-241: Update the focus restoration flow around focusIfNeeded
and its retryTimer to check isTopmostSheet(sheetId) before attempting focus. If
this Sheet is no longer topmost, clear the retry interval and reset
restoreTimers.openFocusRetry so a lower Sheet cannot reclaim focus from the
newer stacked Sheet.

In `@tests/ui-smoke.spec.ts`:
- Around line 3123-3134: Update the focus-restoration assertion around
openSourcesButton to poll only whether it is the current document.activeElement.
Remove the fallback focus call so the test observes production behavior without
repairing focus during the assertion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f96073f3-62b2-49e6-a2d3-b22beaaf91ba

📥 Commits

Reviewing files that changed from the base of the PR and between e2488db and 05373f1.

📒 Files selected for processing (9)
  • docs/branch-review-ledger.md
  • src/components/AccessibleTable.tsx
  • src/components/clinical-dashboard/dashboard-shell.tsx
  • src/components/clinical-dashboard/universal-search-command-surface.tsx
  • src/components/ui/sheet.tsx
  • src/components/universal-search-command-mockups.tsx
  • tests/clinical-dashboard-merge-artifacts.test.ts
  • tests/search-command-surface.test.ts
  • tests/ui-smoke.spec.ts

Comment thread src/components/ui/sheet.tsx
Comment thread tests/ui-smoke.spec.ts
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Gate Sheet autofocus retries on isTopmostSheet, and remove test-side focus repair so production restore failures stay visible.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@cursor
cursor Bot merged commit d43e374 into main Jul 25, 2026
50 checks passed
@cursor
cursor Bot deleted the implement-audit-recommendations-fix branch July 25, 2026 06:53
BigSimmo added a commit that referenced this pull request Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants